
import { Navigate, useRoutes } from 'react-router-dom'
import NoFound from '../components/404'
import Login from '../pages/Login'
import Main from '../pages/Main'
import About from '../pages/Main/About'
import Home from '../pages/Main/Home'
import Music from '../pages/Main/Home/Music/index.jsx'
import News from '../pages/Main/Home/News/index.jsx'


const routes = [
    {
        path:'/login',
        element:<Login />
    },
    {
        path:'/main',
        element:<Main />,
        children:[
            {
                path:'/main/home',
                element:<Home />, 
                children:[
                    {
                        path:'/main/home/Music/:id',
                        element:<Music />,
                    },
                    {
                        path:'/main/home/News/:id',
                        element:<News />,
                    }
                ]
            },
            {
                path:'/main/about',
                element:<About />, 
            }
        ]
    },
    {
        path:'*',
        element:<NoFound />
    },
    {
        path:'/',
        element:<Navigate to='/login' />
    }
]

export default routes;